<template>
  <div>
    <p-table
      row-key="id"
      :columns="columns"
      bordered
      :scroll="{ x: '100%' }"
      :pagination="false"
      :data-source="dataSource"
    >
    </p-table>
  </div>
</template>

<script>
export default {
  props: {
    dataSource: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {};
  },
  computed: {
    statusOptions() {
      return {
        0: '未启动',
        1: '进行中',
        2: '已通过',
        3: '不涉及',
        4: '已失销',
      };
    },
    stageOptions() {
      return {
        1: '商机信息确认',
        2: '商机决策',
        3: '投标',
        4: '立项',
        5: '产品研发及验证',
        6: '商机认证',
        7: '赢单',
      };
    },
    columns() {
      const columns = [
        {
          align: 'center',
          title: '商机阶段',
          dataIndex: 'opportunityStage',
          customRender: text => this.stageOptions[text],
        },
        {
          align: 'center',
          title: '负责人',
          dataIndex: 'currentUserName',
        },

        {
          align: 'center',
          title: '阶段状态',
          dataIndex: 'processStatus',
          customRender: text => this.statusOptions[text],
        },
        {
          align: 'center',
          title: '耗时',
          dataIndex: 'dateDiffrenceFormat',
        },
        {
          align: 'center',
          title: '部门',
          dataIndex: 'departmentName',
        },
        {
          align: 'center',
          title: '职位',
          dataIndex: 'positionName',
        },
      ];
      return columns;
    },
  },
  watch: {},
  created() {},
  methods: {},
};
</script>

<style lang="less" scoped>
.log-container {
  width: 100%;
}
.item-container {
  display: flex;
  align-items: center;
}
.button-container {
  margin-bottom: 20px;
}
.table-container {
  margin-bottom: 40px;
}
/deep/ .poros-select-selection {
  border: none;
}
</style>
